﻿using System;
using UnityEngine;

// Token: 0x02000133 RID: 307
[AddComponentMenu("RVP/C#/Scene Controllers/Global Control", 0)]
[DisallowMultipleComponent]
public class GlobalControl : MonoBehaviour
{
	// Token: 0x060005A2 RID: 1442 RVA: 0x0002C980 File Offset: 0x0002AB80
	private void Start()
	{
		GlobalControl.wheelCastMaskStatic = this.wheelCastMask;
		GlobalControl.groundMaskStatic = this.groundMask;
		GlobalControl.damageMaskStatic = this.damageMask;
		GlobalControl.ignoreWheelCastLayer = LayerMask.NameToLayer("Ignore Wheel Cast");
		GlobalControl.frictionlessMatStatic = this.frictionlessMat;
		GlobalControl.tireMarkLengthStatic = Mathf.Max(this.tireMarkLength, 2);
		GlobalControl.tireMarkGapStatic = this.tireMarkGap;
		GlobalControl.tireMarkHeightStatic = this.tireMarkHeight;
		GlobalControl.tireFadeTimeStatic = this.tireFadeTime;
	}

	// Token: 0x060005A3 RID: 1443 RVA: 0x0002C9FC File Offset: 0x0002ABFC
	private void FixedUpdate()
	{
		GlobalControl.worldUpDir = ((Physics.gravity.sqrMagnitude != 0f) ? (-Physics.gravity.normalized) : Vector3.up);
	}

	// Token: 0x040007FC RID: 2044
	[Tooltip("Mask for what the wheels collide with")]
	public LayerMask wheelCastMask;

	// Token: 0x040007FD RID: 2045
	public static LayerMask wheelCastMaskStatic;

	// Token: 0x040007FE RID: 2046
	[Tooltip("Mask for objects which vehicles check against if they are rolled over")]
	public LayerMask groundMask;

	// Token: 0x040007FF RID: 2047
	public static LayerMask groundMaskStatic;

	// Token: 0x04000800 RID: 2048
	[Tooltip("Mask for objects that cause damage to vehicles")]
	public LayerMask damageMask;

	// Token: 0x04000801 RID: 2049
	public static LayerMask damageMaskStatic;

	// Token: 0x04000802 RID: 2050
	public static int ignoreWheelCastLayer;

	// Token: 0x04000803 RID: 2051
	[Tooltip("Frictionless physic material")]
	public PhysicMaterial frictionlessMat;

	// Token: 0x04000804 RID: 2052
	public static PhysicMaterial frictionlessMatStatic;

	// Token: 0x04000805 RID: 2053
	public static Vector3 worldUpDir;

	// Token: 0x04000806 RID: 2054
	[Tooltip("Maximum segments per tire mark")]
	public int tireMarkLength;

	// Token: 0x04000807 RID: 2055
	public static int tireMarkLengthStatic;

	// Token: 0x04000808 RID: 2056
	[Tooltip("Gap between tire mark segments")]
	public float tireMarkGap;

	// Token: 0x04000809 RID: 2057
	public static float tireMarkGapStatic;

	// Token: 0x0400080A RID: 2058
	[Tooltip("Tire mark height above ground")]
	public float tireMarkHeight;

	// Token: 0x0400080B RID: 2059
	public static float tireMarkHeightStatic;

	// Token: 0x0400080C RID: 2060
	[Tooltip("Lifetime of tire marks")]
	public float tireFadeTime;

	// Token: 0x0400080D RID: 2061
	public static float tireFadeTimeStatic;
}
